/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author amega
 */
@Entity
@Table(name = "orderRoom")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OrderRoom.findAll", query = "SELECT o FROM OrderRoom o"),
    @NamedQuery(name = "OrderRoom.findById", query = "SELECT o FROM OrderRoom o WHERE o.id = :id"),
    @NamedQuery(name = "OrderRoom.findByDateBegin", query = "SELECT o FROM OrderRoom o WHERE o.dateBegin = :dateBegin"),
    @NamedQuery(name = "OrderRoom.findByDateEnd", query = "SELECT o FROM OrderRoom o WHERE o.dateEnd = :dateEnd"),
    @NamedQuery(name = "OrderRoom.findByStatus", query = "SELECT o FROM OrderRoom o WHERE o.status = :status"),
    @NamedQuery(name = "OrderRoom.findByCountPeople", query = "SELECT o FROM OrderRoom o WHERE o.countPeople = :countPeople"),
    @NamedQuery(name = "OrderRoom.findByIsReservation", query = "SELECT o FROM OrderRoom o WHERE o.isReservation = :isReservation"),
    @NamedQuery(name = "OrderRoom.findByDateReservation", query = "SELECT o FROM OrderRoom o WHERE o.dateReservation = :dateReservation")})
public class OrderRoom implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dateBegin")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateBegin;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dateEnd")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateEnd;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "status")
    private String status;
    @Basic(optional = false)
    @NotNull
    @Column(name = "countPeople")
    private int countPeople;
    @Basic(optional = false)
    @NotNull
    @Column(name = "isReservation")
    private boolean isReservation;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dateReservation")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateReservation;
    @JoinColumn(name = "idOrder", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Orders idOrder;
    @JoinColumn(name = "idRoomNumber", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Hotelroom idRoomNumber;

    public OrderRoom() {
    }

    public OrderRoom(Integer id) {
        this.id = id;
    }

    public OrderRoom(Integer id, Date dateBegin, Date dateEnd, String status, int countPeople, boolean isReservation, Date dateReservation) {
        this.id = id;
        this.dateBegin = dateBegin;
        this.dateEnd = dateEnd;
        this.status = status;
        this.countPeople = countPeople;
        this.isReservation = isReservation;
        this.dateReservation = dateReservation;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateBegin() {
        return dateBegin;
    }

    public void setDateBegin(Date dateBegin) {
        this.dateBegin = dateBegin;
    }

    public Date getDateEnd() {
        return dateEnd;
    }

    public void setDateEnd(Date dateEnd) {
        this.dateEnd = dateEnd;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getCountPeople() {
        return countPeople;
    }

    public void setCountPeople(int countPeople) {
        this.countPeople = countPeople;
    }

    public boolean getIsReservation() {
        return isReservation;
    }

    public void setIsReservation(boolean isReservation) {
        this.isReservation = isReservation;
    }

    public Date getDateReservation() {
        return dateReservation;
    }

    public void setDateReservation(Date dateReservation) {
        this.dateReservation = dateReservation;
    }

    public Orders getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(Orders idOrder) {
        this.idOrder = idOrder;
    }

    public Hotelroom getIdRoomNumber() {
        return idRoomNumber;
    }

    public void setIdRoomNumber(Hotelroom idRoomNumber) {
        this.idRoomNumber = idRoomNumber;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrderRoom)) {
            return false;
        }
        OrderRoom other = (OrderRoom) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.OrderRoom[ id=" + id + " ]";
    }
    
}
